<!DOCTYPE html> 
<html>
    <head>
        <title>Cadastro de Grupos         </title>
    </head>
    <body>
        <?php
          session_start();
          require ('./banco.php');
          $mysql = new Banco;
          $rs = $mysql->sql_query("SELECT * FROM grupo WHERE cd_usuario =".$_SESSION['cd_usuario']);
          echo
          "<table>".
                "<th><h1>Cadastrar novo grupo </h1>      </th>".
                  "<tr>".
                        "<td>".
                            "<form action = 'dml.php' method='GET'>".
                                "<input type='hidden'   name = 'table' value='grupo'/>".
                                "<input type = 'text' name='nm_grupo'>".
                                "<input type = 'submit' name = 'cmd'   value='Cadastrar'/>".
                            "</form>".
                        "</td>".
                  "<tr>".
          "</table>";                  
          echo  "<h1><table><th> Grupo </th></h1>";
          while($row = mysqli_fetch_array($rs)){
            $cd_grupo = $row["cd_grupo"];
            $nm_grupo = $row["nm_grupo"];
            echo
            "<tr>"            
                ."<form action = 'dml.php' method='GET'>".
                "<input type='hidden'   name = 'table' value='grupo'/>".                    
                "<input type='hidden'   name = 'cd_grupo' value='$cd_grupo'/>".                
            "<td>".
                 "<input type='text'   name = 'nm_grupo' value='$nm_grupo'/>".
                 "<input type='submit' name = 'cmd'   value='Alterar'/>".
            "</td>"."<td>".
                 "<input type='submit' name = 'cmd'   value='Excluir'/>".					
            "</form>"
         . "</tr><br>";
          }
          echo "</table>";        
        ?>
    </body>
</html>    